import aixos from "axios"
export default {
    namespaced: true,
    state: {
        status:null
    },
    mutations: {
    },
    actions: {
       toLogin({commit},payload){
        //    console.log(payload)
           aixos.post("/login",
            payload
           ).then(res=>{
               console.log(res);
               if (res.data.code ==1 || res.data.code ==2) {
                window.$message({
                    message: '恭喜你成功登陆了',
                    type: 'success'
                  });
                  console.log(this,"this")
                  window.$router.push("/main")
               }
             

           })
       }
    },
}